 
<?php
$host = 'localhost';
$username = 'root';
$password = '';
$dbName = 'b20';
//session_start();

mysql_connect($host, $username ,$password) or
            die(mysql_error().'<br>Unable to establish connection with MYSQL');
mysql_select_db($dbName) or
            die(mysql_error.'<br>Unable to select Database');

 if(isset($_POST['email'])&& !empty($_POST['email']) && isset($_POST['password'])&& !empty($_POST['password'])){
    //pr($_POST);
    $email = mysql_real_escape_string($_POST['email']);
    $password = mysql_real_escape_string($_POST['password']);
    $password = md5(trim($password));

     $query = "SELECT * FROM `users` WHERE `email`='$email' AND `password`='$password' ";
    $result = mysql_query($query) or die(mysql_error());
     
	 
    if(mysql_num_rows($result) == 1){
      echo "CHEERS :)";
       $user = mysql_fetch_assoc($result);
        //var_dump($user);
      //$_SESSION['name'] = $user['name'];
      //$_SESSION['id'] = $user['id'];
      //$_SESSION['email'] = $user['email'];
 
      header('location:pascal3.php');
      exit;
    } else {
      //pr(':( Sorry, login failed..');
    }
} 
?>

 <!DOCTYPE html>
<html>
 <head>
    
    <title>Login.php</title>
    <link href="include/css/bootstrap.css" rel="stylesheet">  
	<link href="include/css/bootstrap-responsive.css" rel="stylesheet">  
	<link href="include/js/bootstrap.js" rel="stylesheet">  
 </head>
  
 <body>
 
 <form name="register" id="registerId" class="form-horizontal"method ="post">
     <div class="control-group">
		<label class="control-label">Name</label>
		<div class="controls">
			<input name="email" type="email" required  value="zeev@andi4.com"/>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label">Password</label>
		<div class="controls">
			<input type="password" id="passwordId" name="password" required  value="1q1q1q1q" >
		</div>
	</div>
	<div class="control-group">
		<div class="controls">
			<input type="submit" class="btn btn-primary btn-small" value="Execute Me!!" >
		</div>
	</div>
	
	
	
	
</form>
 </body>
 </html>
 